<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<title>查看会员</title>
		<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
		<link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="../static/web/css/admin.css">
		<script src="../static/web/js/jquery.min.js"></script>
		<script src="../static/web/js/bootstrap.min.js"></script>
		<script src="js/main.js"></script>
		<script>
			function checkSubmit()
			{
				if (document.form2.email.value=="")
				{
				  document.form2.email.focus();
				  ShowMsg("邮箱不能为空");
				  return false;
				}
				if (document.form2.uname.value=="")
				{
				  document.form2.uname.focus();
				  ShowMsg("会员昵称不能为空");
				  return false;
				}
			}
		</script>
	</head>
	<body>
		<table cellpadding="3" cellspacing="1" align="center" class="table maintable my-3">
			<tr>
				<td bgcolor="#f5f5f5" colspan="2"><a href="<?php echo $ENV_GOBACK_URL;?>">会员管理</a> &gt; 查看会员</td>
			</tr>
			<?php if ($row['matt']==10) echo '<tr><td colspan="2"><div class="alert alert-info mb-0">当前会员是关连网站管理员，谨慎操作</div></td></tr>';?>
			<form name="form2" action="member_do.php" method="post" onSubmit="return checkSubmit();">
				<input type="hidden" name="dopost" value="edituser">
				<input type="hidden" name="id" value="<?php echo $id?>">
				<tr>
					<td width="260" class="admin-td">头像/会员名：</td>
					<td>
						<span class="mr-1"><?php if ($row['face']!='') {echo "<img src='{$row['face']}' class='user-img'>";};echo "".$row['userid']."";?></span>
						<span class="btn btn-outline-success btn-sm"><?php echo GetMemberTypeName($row['rank']);?></span>
						<span class="btn btn-outline-warning btn-sm"><?php echo GetHonor($row['scores']);?></span>
					</td>
				</tr>
				<tr>
					<td class="admin-td">昵称：</td>
					<td class="admin-td"><input type="text" name="uname" id="uname" class="admin-input-sm" value="<?php echo $row['uname']?>"></td>
				</tr>
				<tr>
					<td class="admin-td">密码：</td>
					<td><input type="text" name="pwd" id="pwd" class="admin-input-sm">（留空则不修改，只能用[0-9a-zA-Z_@!.-]以内范围的字符）</td>
				</tr>
				<tr>
					<td class="admin-td">邮箱：</td>
					<td class="admin-td"><input type="text" name="email" id="email" class="admin-input-sm" value="<?php echo $row['email']?>"></td>
				</tr>
				<tr>
					<td class="admin-td">性别：</td>
					<td class="admin-td">
						<label><input type="radio" name="sex" value="男" <?php if ($row['sex']=="男" ) echo" checked='1'" ;?>> 男</label>
						<label><input type="radio" name="sex" value="女" <?php if ($row['sex']=="女" ) echo" checked='1'" ;?>> 女</label>
						<label><input type="radio" name="sex" value="" <?php if ($row['sex']=="" ) echo" checked='1'" ;?>> 保密</label>
					</td>
				</tr>
				<tr>
					<td class="admin-td">钱包积分：</td>
					<td class="admin-td">
						<span class="mr-1">金币：<input type="text" name="money" id="money" class="admin-input-xs" value="<?php echo $row['money'];?>"></span>
						<span class="mr-1">积分：<input type="text" name="scores" id="scores" class="admin-input-xs" value="<?php echo $row['scores'];?>"></span>
						<span>余额：<input type="text" name="user_money" id="user_money" class="admin-input-xs" value="<?php echo $row['user_money'];?>"></span>
					</td>
				</tr>
				<tr>
					<td class="admin-td">等级：</td>
					<td class="admin-td">
						<?php
						$MemberTypes = array();
						$dsql->SetQuery("SELECT `rank`,membername From `#@__arcrank` where `rank`>0");
						$dsql->Execute('n');
						$MemberTypes[0] = "限制会员";
						while($nrow = $dsql->GetObject('n')){
							$MemberTypes[$nrow->rank] = $nrow->membername;
						}
						$options = "<select name='rank' class='admin-input-sm'>";
						foreach($MemberTypes as $k=>$v)
						{
							if ($k!=$row['rank']) $options .= "<option value='$k'>$v</option>";
							else $options .= "<option value='$k' selected>$v</option>";
						}
						$options .= "</select>";
						echo $options;
						?>
					</td>
				</tr>
				<tr>
					<td class="admin-td">升级时间：</td>
					<td class="admin-td"><input type="text" name="uptime" id="uptime" class="admin-input-sm" value="<?php echo $row['uptime']=($row['uptime']=='0')? GetDateTimeMk(time()) : GetDateTimeMk($row['uptime']);?>">（如果您要升级会员，必须设置此时间为当前时间）</td>
				</tr>
				<tr>
					<td class="admin-td">会员天数：</td>
					<td class="admin-td"><input type="text" name="exptime" id="exptime" class="admin-input-sm" value="<?php echo $row['exptime']?>">（如果您要升级会员，会员天数必须大于0）</td>
				</tr>
				<?php if ($mhasDay!=0) {$mhasDay=($mhasDay>0)? $mhasDay : '<tr><td colspan="2" class="admin-td"><span class="text-danger">会员已经到期</span></td></tr>';?>
				<tr>
					<td class="admin-td">剩余天数：</td>
					<td class="admin-td"><?php echo $mhasDay;?></td>
				</tr>
				<?php }?>
				<tr>
					<td class="admin-td">推荐级别：</td>
					<td class="admin-td">
						<input type="hidden" name="oldmatt" id="oldmatt" class="admin-input-sm" value="<?php echo $row['matt']?>">
						<input name="matt" type="text" id="matt" class="admin-input-sm" value="<?php echo $row['matt']?>">（0普通、1推荐、10管理员）
					</td>
				</tr>
				<tr>
					<td class="admin-td">投稿限制：</td>
					<td class="admin-td">
						<input type="text" name="send_max" class="admin-input-xs" value="<?php echo $row['send_max']?>">（0为不能投稿）
					</td>
				</tr>
				<tr>
					<td class="admin-td">资料状况：</td>
					<td class="admin-td">
						<select name="spacesta" class="admin-input-sm">
							<?php
							foreach($staArr as $k=>$v)
							{
								if ($row['spacesta']==$k) echo "<option value='$k' selected>$v</option>";
								else echo "<option value='$k'>$v</option>";
							}
							?>
						</select>
					</td>
				</tr>
				<tr>
					<td>空间信息：</td>
					<td class="admin-td">
						<?php
						$nrow = $dsql->GetOne("SELECT * FROM `#@__member_tj` WHERE mid='{$row['mid']}'");
						echo "文档：{$nrow['article']} 图片：{$nrow['album']} 收藏：{$nrow['stow']} 浏览：{$nrow['pagecount']}";
						?>
					</td>
				</tr>
				<tr>
					<td class="admin-td">注册时间/地址：</td>
					<td class="admin-td">
						<span class="mr-1"><?php echo GetDateTimeMk($row['jointime'])?></span>
						<span><?php echo $row['joinip']?></span>
					</td>
				</tr>
				<tr>
					<td class="admin-td">最近时间/地址：</td>
					<td class="admin-td">
						<span class="mr-1"><?php echo GetDateTimeMk($row['logintime'])?></span>
						<span><?php echo $row['loginip']?></span>
					</td>
				</tr>
				<tr>
					<td class="admin-td">管理操作：</td>
					<td class="admin-td">
						<a href="member_do.php?dopost=memberlogin&id=<?php echo $row['mid'];?>&jumpurl=../user/edit_baseinfo.php" target="_blank" class="btn btn-success btn-sm">修改资料</a>
						<a href="member_do.php?dopost=memberlogin&id=<?php echo $row['mid'];?>" target="_blank" class="btn btn-success btn-sm">会员面板</a>
					</td>
				</tr>
				<tr>
					<td bgcolor="#f5f5f5" colspan="2" align="center">
						<button type="submit" name="Submit" class="btn btn-success btn-sm">保存</button>
						<button type="button" class="btn btn-outline-success btn-sm" onclick="javascript:history.go(-1);">返回</button>
					</td>
				</tr>
			</form>
		</table>
	</body>
</html>